package com.example.administrator.myapplication;

import android.widget.TextView;

import com.example.administrator.myapplication.view.CustomDialog;
import com.sv.svbind.context.AppActivity;

/**
 * Created by Administrator on 2016/7/27.
 */
public class BaseActivity extends AppActivity {

    private CustomDialog loadingDialog;
    private long mExitTime;

    /**
     * 显示加载中对话框
     *
     * @param text
     */
    public void showLoadingDialog(String text) {
        if (loadingDialog == null) {
            loadingDialog = new CustomDialog(this,
                    R.style.custom_dialog_dim_enabled, R.layout.dialog_loading);
        }
        loadingDialog.show();
        TextView tv = (TextView) loadingDialog
                .findViewById(R.id.loading_dialog_tv);
        tv.setText(text);
        loadingDialog.setCanceledOnTouchOutside(false);
        loadingDialog.setCancelable(true);
    }

    /**
     * 隐藏加载中对话框
     */
    public void dismissLoadingDialog() {
        if (loadingDialog != null) {
            loadingDialog.dismiss();
        }
    }

    /**
     * Take care of calling onBackPressed() for pre-Eclair platforms.
     *
     * @param keyCode
     * @param event
     */


}

